@{
    var profile = (System.Web.Profile.ProfileBase)Model;
    var _user = Membership.GetUser(profile.UserName);
    var avatar = _user.GetAvatar(120);
    string _class = _user.IsOnline ? "forum-icon forum-icon-useronline" : "forum-icon forum-icon-useroffline";
    var imgUrl = profile.GetProfileGroup("Forum")["Medal"].ToString();
    if (!string.IsNullOrEmpty(imgUrl))
    {
        if (imgUrl.StartsWith("%theme%"))
        {
            imgUrl = Url.ThemeContent(imgUrl.Replace("%theme%", ""));
        }
        else
        {
            imgUrl = Url.Content(imgUrl);
        }
    }
}
<table>
    <tr>
        <td>@Html.UserLink(_user.UserName)
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center;">
            <div class="d-avatar ui-corner-all">
                <a href="@_user.GetPermalinkUrl()" target="_blank">
                    <img src="@Url.Content(avatar)" width="120px" height="120px" alt="" class="ui-corner-all" /></a></div>
        </td>
    </tr>
    @if (!string.IsNullOrEmpty(imgUrl))
    {
        <tr>
            <td colspan="2" style="text-align: center;">
                <img src="@imgUrl" alt="" />
            </td>
        </tr>
    }
    <tr>
        <td colspan="2" style="text-align: center; color: Gray;">
            @profile.GetProfileGroup("Forum")["Rank"]
        </td>
    </tr>
    <tr>
        <td colspan="2">
            @Html.Global((int)profile["Points"]) @Html.Global("RES_POINTS")
        </td>
    </tr>
    <tr>
        <td>@profile.GetProfileGroup("Forum")["TotalThreads"] @Html.Global("forums", "Threads")
        </td>
    </tr>
    <tr>
        <td>@profile.GetProfileGroup("Forum")["TotalPosts"] @Html.Global("forums", "Posts")
        </td>
    </tr>
    @if (!string.IsNullOrEmpty(profile["Twitter"] as string))
    { 
        <tr>
            <td colspan="2">
                @Twitter.FollowButton(profile["Twitter"] as string, followStyle: "follow_bird")
            </td>
        </tr>
    }
</table>
